package com.yalemang.androidclassroom.day04

import android.content.Intent
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.yalemang.androidclassroom.R
import org.greenrobot.eventbus.EventBus

class AActivity:AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_a)
        findViewById<TextView>(R.id.tv).setOnClickListener {
            //发送粘性事件
            EventBus.getDefault().postSticky(TestEvent())
            startActivity(Intent(this@AActivity,BActivity::class.java))
        }
    }

}